import {
  ADD_COUNTER,
  ADD_TO_CART
} from "@/store/mutation-types";

export default {
  // 旧商品+1
  [ADD_COUNTER](state,payload){
    payload.count++
  },
  // 新商品加入
  [ADD_TO_CART](state,payload){
    // 新商品加入后，在购物车里面即是默认选中状态
    payload.isChecked = true
    state.cartList.push(payload)
  }
}
